#ifndef _DATASOURCE_H
#define	_DATASOURCE_H

#include <list>
#include <string>
#include "genealogy_tree/GenealogyTree.h"
#include "genealogy_tree/Photo.h"
#include "DataSourceException.h"

namespace etu {
namespace db {

using etu::genealogy_tree::GenealogyTree;
using etu::genealogy_tree::Person;
using etu::genealogy_tree::Photo;

class DataSource {
public:
    DataSource() {}
    // DataSource(const DataSource& orig);
    virtual ~DataSource() {}

    // GenealogyTree

    virtual bool isGenealogyTreeExists(const std::string& name)
        throw(DataSourceException) = 0;
    virtual GenealogyTree* getGenealogyTree(const std::string& name)
        throw(DataSourceException) = 0;
    virtual std::list<std::string>* getGenealogyTreeNames()
        throw(DataSourceException) = 0;
    virtual void addGenealogyTree(const std::string& name, const GenealogyTree& tree)
        throw(DataSourceException) = 0;
    virtual void deleteGenealogyTree(const std::string& name)
        throw(DataSourceException) = 0;
    virtual void updateGenealogyTree(const std::string& name, 
        const GenealogyTree& tree) throw(DataSourceException) = 0;
    
    // Photo

    virtual bool isPhotoExists(const Person& person)
        throw(DataSourceException) = 0;
    virtual Photo* getPhoto(const Person& person)
        throw(DataSourceException) = 0;
    virtual void addPhoto(Person* person, const Photo& photo)
        throw(DataSourceException) = 0;
    virtual void deletePhoto(const Person& person)
        throw(DataSourceException) = 0;
};

}
}

#endif	/* _DATASOURCE_H */

